<!DOCTYPE html>
<html lang="en-US">
<head>
    <meta charset="utf-8">
    <title>My test page</title>
</head>
<body>
<p>This is my page</p>
<script>
    let promise = fetch('coffee.jpg');
    function response() {
        return response.blob();
    }
    let promise2 = promise.then(response => {
        if (!response.ok){
            throw new Error(`HTTP error! status: ${response.status}`);
        } else{
            return response.blob();
        }
    })

    let promise3 = promise2.then(myBlob => {
        let objectURL = URL.createObjectURL(myBlob);
        let image = document.createElement("img");
        image.src = objectURL;
        document.body.appendChild(image);
    })
</script>
</body>
</html>